/**
 * Copyright 2021 xpstem.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.xpstem.lelink.operation;

import com.xpstem.lelink.enums.OpCode;
import com.xpstem.lelink.type.Data32;
import com.xpstem.lelink.type.Data8;

/**
 * EV3 general operations.
 *
 * @author billy zhang
 */
public class EV3GeneralOpFactory {

    private EV3GeneralOpFactory() { }

    /**
     * Instruction can be used to indicate error. This code is not normally used in programs.
     * @return
     */
    public static EV3Operation opError() {
        EV3OperationPackage opPackage = new EV3OperationPackage(OpCode.ERROR, null);
        return new EV3Operation( opPackage);
    }

    /**
     * Instruction will do nothing.
     * @return
     */
    public static EV3Operation opNop() {

        EV3OperationPackage opPackage = new EV3OperationPackage(OpCode.NOP, null);
        return new EV3Operation( opPackage);
    }

    public static EV3Operation opPortCnvOutput(
            Data32 portIn, Data8 layer, Data8 bitfield, Data8 inverted) {
        return null;
    }

    public static EV3Operation opPortCnvInput(
            Data32 portIn, Data8 layer, Data8 portOut) {
        return null;
    }

}
